package by.msokoloff.javaweb2015.services;

import java.math.BigDecimal;
import java.util.List;

import javax.persistence.metamodel.SingularAttribute;

import org.springframework.transaction.annotation.Transactional;

import by.msokoloff.javaweb2015.datamodel.TripOrder;

public interface TripOrderService {

	TripOrder get(Integer id);

	List<TripOrder> getByField(SingularAttribute<TripOrder, ?> attr, Object val);

	List<TripOrder> getAll();

	@Transactional
	void createOrUpdate(TripOrder tripOrder);

	@Transactional
	void delete(TripOrder tripOrder);

	@Transactional
	void deleteAll();

	BigDecimal getPrice(TripOrder tripOrder);

	long getCount();

	List<TripOrder> getAll(SingularAttribute<TripOrder, ?> sortParam, boolean ascending, int first, int count);

}
